﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sage.DownloadLite.Exceptions
{
    /// <summary>
    /// 下载相关异常
    /// </summary>
    public class DownloadException : Exception
    {
        /// <summary>
        /// 任务ID
        /// </summary>
        public int? TaskId { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">错误消息</param>
        public DownloadException(string message) : base(message) { }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">错误消息</param>
        /// <param name="innerException">内部异常</param>
        public DownloadException(string message, Exception innerException) : base(message, innerException) { }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">错误消息</param>
        /// <param name="taskId">任务ID</param>
        public DownloadException(string message, int taskId) : base(message)
        {
            TaskId = taskId;
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">错误消息</param>
        /// <param name="taskId">任务ID</param>
        /// <param name="innerException">内部异常</param>
        public DownloadException(string message, int taskId, Exception innerException) : base(message, innerException)
        {
            TaskId = taskId;
        }
    }
}
